Component({
  properties: {
    account: {
      type: Object,
      value: {},
      observer(newVal, oldVal, changedPath) {
        if (newVal && Object.keys(newVal).length > 0) {
          this.setData({
            balance: +newVal.balance,
            platform_ticket: +newVal.platform_ticket,
            score: +newVal.score + +newVal.tmp_score,
            store: +newVal.store_count,
          })
        }
      }
    }
  },
  data: {
    balance: 0,
    platform_ticket: 0,
    score: 0,
    store: 0
  },
  methods: {
    goStorePull() {
      wx.navigateTo({
        url: '/sub_service/pages/store/pull/index'
      })
    },
    onStore() {
      wx.navigateTo({
        url: '/sub_service/pages/store/list/index'
      })
    },
    goStore() {

    },
    onBalance() {
      wx.navigateTo({
        url: '/sub_service/pages/account/balance/index?s=1'
      })
    },
    onPlatformTicket() {
      wx.navigateTo({
        url: '/sub_service/pages/account/platform-ticket/index?s=1'
      })
    },
    onScore() {
      wx.navigateTo({
        url: '/sub_service/pages/account/score/index?s=1'
      })
    }
  }
});
